import App from './App'
import store from './store'
import { buildUrl } from './utils/url.js'
import { onRequest, onResponse } from '@/utils/request.js'
import { setDefaultShareData } from '@/utils/share.js'
import { setPagePopupActive } from '@huntianning/miniprogram/components/ui-page/utils.js'
import i18n from '@/utils/index.js'
import languageManager from '@/utils/language'


languageManager.setI18n(i18n)
store.watch((state, getters) => {
	return getters.pagePopupActive
}, (newValue) => {
	setPagePopupActive(newValue)
})

// 请求传递token
onRequest((options) => {
})

setDefaultShareData({
	title: '致力于成为中国制造产品落地沙特最优合作商',
	imageUrl: '/static/images/share-app.png',
	path: '/pages/launch/launch'
})

// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
    i18n,
	store,
    ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif
